<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:t="http://myfaces.apache.org/tomahawk">

<f:view>
<f:loadBundle var="text" basename="#{basePage.bundleName}"/>
<head>
    <title>#{text['menu.product.category.title']}</title>
    <meta name="heading" content="#{text['menu.product.category.title']}"/>
    <meta name="menu" content="AdminMenu"/>
</head>

<body id="productCategoryList">
    <div class="separator"></div>    

	<h:form id="productCategoryListForm">
		<h:commandButton value="#{text['button.add']}" action="#{productCategoryForm.callAddNewProduct}" id="add" styleClass="button"/>
		<h:commandButton value="#{text['button.done']}" action="mainMenu" id="cancel"
    		immediate="true" styleClass="button" style="margin-left: 5px"/>
    		<t:dataTable id="productCategoryForm" var="productCategory" style="margin-top: 10px" 
    			sortColumn="#{productCategoryForm.sortColumn}" value="#{productCategoryForm.productCategoryList}" rows="25" styleClass="scrollerTable table"
    			headerClass="standardTable_Header" rowClasses="standardTable_Row1,standardTable_Row2"
    columnClasses="standardTable_Column,standardTable_Column,standardTable_Column,standardTable_Column,standardTable_ColumnCentered">		   			
		   			<t:column width="25%">
        				<f:facet name="header">
            				<t:commandSortHeader columnName="name" arrow="true">
                				<h:outputText value="#{text['menu.product.category.title']}" />
            				</t:commandSortHeader>
        				</f:facet>
        				<h:commandLink action="#{productCategoryForm.callEditProductCategory}" value="#{productCategory.name}" >
            				<f:param name="id" value="#{productCategory.id}"/>
        				</h:commandLink>
				    </t:column>
				    <t:column width="25%">
        				<f:facet name="header">
            				<t:commandSortHeader columnName="preview" arrow="true">
                				<h:outputText value="#{text['menu.product.category.preview']}" />
            				</t:commandSortHeader>
        				</f:facet>
        					<t:graphicImage url="/resource/image/${productCategory.image.URI}"></t:graphicImage>
				    </t:column>
    		</t:dataTable>
	</h:form>
	</body>
</f:view>
</html>
